<%inherit file="/dashboard/site.mako" />
<%def name="title()">Dashboard</%def>
<%
	def print_list_news(news_db):	
		all_news = ''
		
		
		for news in news_db:
			tr = '<tr>'
			tr = tr + '<td>'+str(news.id)+'</td>'
			tr = tr + '<td>' + news.title[:50] + '</td>'
			tr = tr + '<td><a href="/dashboard/modif_news_id/' + str(news.id) + '">Modifier</a></td>'
			tr = tr + '</tr>'
			all_news = all_news + tr

		return all_news
%>
<div style="padding: 20px;">
	<div>
	${c.message | n}
	%if request.params.get('modified') == 'yes':
		<span class='success_message'>La news a ete correctement modifiee</span>
	%elif request.params.get('modified') == 'no':
		<span class='error_message'>La news n'a pas ete modifiee - tout les champs sont requit</span>
	%endif
	</div>
	<p>Modifer une news</p>
	<table style="font-size: 12px;">
		<tr style="background: grey; color: white;"><td>ID</td><td style="width: 300px;">Titre</td><td></td></tr>		
		
		${print_list_news(c.news) | n}
		
	</table>
</div>
